﻿using CURD.Serivce;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace CURD.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TestTController : ControllerBase
    {
        private readonly Calculator calculator;

        public TestTController(Calculator calculator)
        {
            this.calculator = calculator;
        }


        [HttpGet]
        public int Calculator(int x, int y)
        {
            return calculator.Add(x, y);
        }

        //如果有非常耗时间的服务注册 就给他单独 注册

        [HttpGet]
        public string GetLongTime(TestService testService, string x)
        {
            string a = testService.LongTimeSerice() + x;
            return a;
        }
    }


}
